package com.boatAnchorAssistant.pojo.entity;

import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import nirvana.core.domains.ann.AccEntity;
import nirvana.core.domains.entity.DomainBaseEntity;
import org.springframework.data.annotation.Id;

import javax.persistence.Table;

/**
 * @author Joseph.Li
 * @author joseph.li@king-v.com
 * Created in 2022-06-16 22:51
 *
 *  树节点，维护祖先于后代的关系
 *
 */
@Data
@Table
@AccEntity("树节点")
@TableComment("树节点")
public class TreeNode extends DomainBaseEntity<TreeNode> {



    /**
     * 祖先
     */
    @Id
    @Column(type = MySqlTypeConstant.BIGINT,
            length = 20,
            isNull = false,
            comment = "祖先")
    private Long progenitor;


    /**
     * 后代
     */
    @Id
    @Column(type = MySqlTypeConstant.BIGINT,
            length = 20,
            isNull = false,
            comment = "后代")
    private Long descendant;


    /**
     * 距离
     */
    @Id
    @Column(type = MySqlTypeConstant.INT,
            length = 11,
            isNull = false,
            comment = "距离")
    private Integer distance;

}
